<template>
    <div v-if="visible" class="modal-overlay">
        <view class="modal-overlay-bg" style="height: {{height}}">
            <div class="popup-title">
                <div class="popup-title-text">{{title}}</div>
                <div class="close-popup"  @click.stop="close">关闭</div>
            </div>
            <div class="popup-content">
                <slot></slot>
            </div>
            <div class="footer" v-if="title !== '已入职'">
                <div class="btn" @click="submit">确定</div>
            </div>
        </view>
    </div>   
</template>
<script>
    /**
     *  引入工具类库 或 Navtive API
     *  example : import widget from 'gapi/widget'
     */

    /**
     *  引入Action
     *  example : import { someFunction } from './SomeAction'
     */
    
    /**
     *  引入Getter
     *  example : import { someFunction } from './SomeGetters'
     */

    export default {
        vuex: {
            getters: {
                
            },
            actions: {

            }
        },
        props: {
            visible: {
                type: Boolean,
                default: false
            },
            title:{
                type: String,
                default: '入职确认'
            },
            isHideBtn:{
                type: Boolean,
                default: false
            },
            height:{
                type: String,
                default: '90%'
            }
        },
        methods: {
            show(){
                this.$emit('show')
            },
            close () {
                this.$emit('close')
            },
            submit(){
                this.$emit('submit')
            }
            
        },
        created (){
            
        }
    }

    
</script>
<style scoped>
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-overlay-bg{
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    border-radius: 10px 10px 0 0;
}
.popup-title{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    border-bottom: 1px solid #eeeeee;
}
.popup-title-text{
    flex: 1;
}
.close-popup{
    /* width: 90px; */
    padding: 3px 12px;
    text-align: right;
    /* border: 1px solid rgb(242, 242, 242); */
}

.popup-content {
  box-sizing: border-box;
  overflow: auto;
  flex: 1;
}
.footer{
    width: 100%;
    height: 90px;
    line-height: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center
}
.btn{
    width: 80%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: #fa0;
    color: #ffffff;
    font-size: 18px;
}
</style>

